package com.xiandou.open.api.controller;

import com.xiandou.service.DemoService;
import com.xiandou.model.Demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rocpeng
 */
@RequestMapping("/demo-controller")
@RestController
public class DemoController {
    @Autowired
    private DemoService demoService;

    @GetMapping("/{id}")
    public Demo getUser(@PathVariable Long id) throws Exception {
        return demoService.getUser(id);
    }

}
